package tk1.uebung3.model;

public class ProductType {

	private String name;
	private double price;
	private int availableAmount;
	
	public ProductType(){
		
	}
	
	public ProductType(String name, double price, int availableAmount) {
		super();
		this.name = name;
		this.price = price;
		this.availableAmount = availableAmount;
	}

	public boolean purchase(int amount){
		if(amount <= availableAmount){
			availableAmount -= amount;
			return true;
		}
		return false;
	}
	
	public String getName() {
		return name;
	}

	public double getPrice() {
		return price;
	}

	public int getAvailableAmount() {
		return availableAmount;
	}
}
